﻿using Masuit.Tools.Core.Validator;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using WebService.Models;

namespace WebService.EF.Tables
{
    /// <summary>
    /// 称重数据缓存表
    /// </summary>
    [Comment("称重数据缓存表")]
    public partial class WeighingDataCache : CommonTableEntity
    {
        /// <summary>
        /// 业务编号
        /// </summary>
        [Comment("业务编号")]
        [Display(Name = "业务编号")]
        [StringLength(200)]
        [MaxLength(200, ErrorMessage = "{0}超长")]
        public string TicketCode { get; set; }

        /// <summary>
        /// 车牌号
        /// </summary>
        [Comment("车牌号")]
        [Display(Name = "车牌号")]
        [Required(ErrorMessage = "{0}必填")]
        [StringLength(50)]
        [MaxLength(50, ErrorMessage = "{0}超长")]
        public string CarPlateNumber { get; set; }

        /// <summary>
        /// 物资编码
        /// </summary>
        [Comment("物资编码")]
        [Display(Name = "物资编码")]
        [StringLength(100)]
        [MaxLength(100, ErrorMessage = "{0}超长")]
        public string GoodsCode { get; set; }

        /// <summary>
        /// 物资名称
        /// </summary>
        [Comment("物资名称")]
        [Display(Name = "物资名称")]
        [StringLength(200)]
        [MaxLength(200, ErrorMessage = "{0}超长")]
        public string GoodsName { get; set; }

        /// <summary>
        /// 运输重量
        /// </summary>
        [Comment("运输重量")]
        [Display(Name = "运输重量")]
        [MinValue(-1, ErrorMessage = "{0}不能为复数")]
        public decimal GoodsWeight { get; set; }

        /// <summary>
        /// 物资类型
        /// </summary>
        [Comment("物资类型")]
        [Display(Name = "物资类型")]
        [StringLength(20)]
        [MaxLength(20, ErrorMessage = "{0}超长")]
        public string GoodsType { get; set; }

        /// <summary>
        /// 货运单位
        /// </summary>
        [Comment("货运单位")]
        public FreightUnit FreightUnit { get; set; }

        /// <summary>
        /// 发货单位
        /// </summary>
        [Comment("发货单位")]
        [Display(Name = "发货单位")]
        [StringLength(100)]
        [MaxLength(100, ErrorMessage = "{0}超长")]
        public string Sender { get; set; }

        /// <summary>
        /// 收货单位
        /// </summary>
        [Comment("收货单位")]
        [Display(Name = "收货单位")]
        [StringLength(100)]
        [MaxLength(100, ErrorMessage = "{0}超长")]
        public string Receiver { get; set; }

        /// <summary>
        /// 预留字段1
        /// </summary>
        [Comment("预留字段1")]
        public string Reserve1 { get; set; }

        /// <summary>
        /// 预留字段2
        /// </summary>
        [Comment("预留字段2")]
        public string Reserve2 { get; set; }

        /// <summary>
        /// 预留字段3
        /// </summary>
        [Comment("预留字段3")]
        public string Reserve3 { get; set; }

        /// <summary>
        /// 预留字段4
        /// </summary>
        [Comment("预留字段4")]
        public string Reserve4 { get; set; }

        /// <summary>
        /// 到期时间
        /// </summary>
        [Comment("到期时间")]
        public DateTime? ExpireDate { get; set; }

        /// <summary>
        /// 收发标志
        /// </summary>
        [Comment("收发标志")]
        public string SendOrReceiveFlag { get; set; }
    }
}
